//
//  MineTableViewController.m
//  mafengwo
//
//  Created by Mac on 16/3/9.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "MineTableViewController.h"

@interface MineTableViewController ()

@end

@implementation MineTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

-(void)awakeFromNib{
    //设置控制器的 题目(导航栏) 标签图片(标签栏)
    self.title = @"我的";
    self.tabBarItem.image = [UIImage imageNamed:@"mine.png"];
    self.tabBarItem.title = nil;

    //导航栏的左item
    UIButton *setButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 40)];
    [setButton setImage:[UIImage imageNamed:@"set.png"] forState:UIControlStateNormal];
    [setButton addTarget:self action:@selector(setACtion) forControlEvents:UIControlEventTouchUpInside];

    UIBarButtonItem *setItem = [[UIBarButtonItem alloc]initWithCustomView:setButton];
    self.navigationItem.leftBarButtonItem = setItem;

    //导航栏的右item
    UIButton *bell = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 40)];
    [bell setImage:[UIImage imageNamed:@"bells.png"] forState:UIControlStateNormal];
    [bell addTarget:self action:@selector(setACtion) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *bellItem = [[UIBarButtonItem alloc]initWithCustomView:bell];
    self.navigationItem.rightBarButtonItem = bellItem;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)setACtion{
    NSLog(@"AAAAAA");
//    [self prepareForSegue:<#(nonnull UIStoryboardSegue *)#> sender:<#(nullable id)#>]
}

#pragma mark - Table view data source
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {


//    NSLog(@"%@",indexPath);
    
}

/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
